package leetcode100;

import java.util.*;

/**
 * @author shkstart
 * linkedHashMap是有序插入
 * 普通的HashMap是没有顺序插入的
 * @create 2022-12-24-22:21
 */
public class Meme22_2 {
    public static void main(String[] args) {
        Scanner scanner = new Scanner(System.in);
        String str = scanner.next();
        char[] arr = str.toCharArray();

        HashMap<Character,Integer> hashMap = new LinkedHashMap<>();

        for (int i = 0; i < arr.length; i++) {
            if(hashMap.containsKey(arr[i])){
                int value = hashMap.get(arr[i]);
                hashMap.put(arr[i],value+1);
            }else{
                hashMap.put(arr[i],1);
            }
        }
        Set<Map.Entry<Character,Integer>> set = hashMap.entrySet();
        for (Map.Entry<Character,Integer> entry : set) {
            if(entry.getValue()==1){
                System.out.println(entry.getKey());
                return;
            }
        }

        System.out.println(-1);

    }
}
